home *** CD-ROM | disk | FTP | other *** search
- ' ********************************************************
- ' * GLOBAL DECLARATIONS *
- ' ********************************************************
- Global SavedPointer As Integer
- Global PrintCancelFlag As Integer
- Global ReportSelection As Integer
- Global ActiveTransaction As Integer
-
- Global Const KEY_LEFT = &H25
- Global Const KEY_UP = &H26
- Global Const KEY_RIGHT = &H27
- Global Const KEY_DOWN = &H28
- Global Const KEY_PAGE_UP = &H21
- Global Const KEY_PAGE_DOWN = &H22
- Global Const KEY_F1 = &H70
- Global Const KEY_F2 = &H71
- Global Const KEY_F3 = &H72
- Global Const KEY_F4 = &H73
- Global Const KEY_F5 = &H74
- Global Const KEY_F6 = &H75
- Global Const KEY_F7 = &H76
- Global Const KEY_F8 = &H77
-
- 'Fonts Dialog Flags
- Global Const CF_SCREENFONTS = &H1&
- Global Const CF_PRINTERFONTS = &H2&
- Global Const CF_BOTH = &H3&
- Global Const CF_SHOWHELP = &H4&
- Global Const CF_INITTOLOGFONTSTRUCT = &H40&
- Global Const CF_USESTYLE = &H80&
- Global Const CF_EFFECTS = &H100&
- Global Const CF_APPLY = &H200&
- Global Const CF_ANSIONLY = &H400&
- Global Const CF_NOVECTORFONTS = &H800&
- Global Const CF_NOSIMULATIONS = &H1000&
- Global Const CF_LIMITSIZE = &H2000&
- Global Const CF_FIXEDPITCHONLY = &H4000&
- Global Const CF_WYSIWYG = &H8000& 'must also have CF_SCREENFONTS & CF_PRINTERFONTS
- Global Const CF_FORCEFONTEXIST = &H10000
- Global Const CF_SCALABLEONLY = &H20000
- Global Const CF_TTONLY = &H40000
- Global Const CF_NOFACESEL = &H80000
- Global Const CF_NOSTYLESEL = &H100000
- Global Const CF_NOSIZESEL = &H200000
-
-
- Global Const BOPEN = 0
- Global Const BCLOSE = 1
- Global Const BINSERT = 2
- Global Const BUPDATE = 3
- Global Const BDELETE = 4
- Global Const BNEXT = 6
- Global Const BPREVIOUS = 7
- Global Const BFIRST = 12
- Global Const BLAST = 13
- Global Const BEQUAL = 5
- Global Const BBEGTRANS = 19
- Global Const BABOTRANS = 21
- Global Const BENDTRANS = 20
- Global Const BGETGE = 9
-
- 'Printer orientation
-
- Type ORIENT
- Orientation As Long
- Pad As String * 16
- End Type
- Declare Function PrtOrient% Lib "GDI" Alias "Escape" (ByVal hDc%, ByVal nEsc%, ByVal nLen%, lpData As ORIENT, lpOut As Any)
-
- Global prtO As ORIENT
-
- 'Configuration file layout
-
- Type CfgType
- PrintOptNumber As Integer
- FontName As String * 80
- FontSize As Integer
- TopMargin As Integer
- LeftMargin As Integer
- LabelWidth As Integer
- LabelHeight As Integer
- LabelRows As Integer
- LabelColumns As Integer
- DescriptionX As Integer
- DescriptionY As Integer
- DescriptionFS As Integer
- RecipeNoX As Integer
- RecipeNoY As Integer
- RecipeNoFS As Integer
- PriceX As Integer
- PriceY As Integer
- PriceFS As Integer
- ShelfLifeX As Integer
- ShelfLifeY As Integer
- ShelfLifeFS As Integer
- LandPortFlag As Integer
- ToolBar As Integer
- End Type
-
- Global CfgRec As CfgType
-
- Type WorkType
- RecNo As String * 6
- Description As String * 30
- Price As String * 5
- ShelfLife As String * 3
- End Type
-
- Global WorkRec As WorkType
-
- '****************************************************************
- '* Position Block user defined type *
- '****************************************************************
-
- Type PosBlk
- PBelements As String * 128
- End Type
-
- '**********************************************************************
- '* Declare btrieve calls *
- '**********************************************************************
-
- Declare Function WBtrvInit Lib "wbtrcall.dll" (ByVal init$) As Integer
- Declare Function WBtrvStop Lib "wbtrcall.dll" () As Integer
- Declare Function btrcall Lib "wbtrcall.dll" (ByVal op%, Pb As PosBlk, Db As Any, Dl As Integer, ByVal Kb$, ByVal Kl%, ByVal Kn%) As Integer
-
- Sub AbortTransaction ()
- KeyBufLen% = 255
- BufLen% = 1
- KeyNum% = 0
- St% = 0
- St% = btrcall(BABOTRANS, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- ActiveTransaction = False
-
- End Sub
-
- Sub BeginTransaction ()
- KeyBufLen% = 255
- BufLen% = 1
- KeyNum% = 0
- St% = 0
- St% = btrcall(BBEGTRANS, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- ActiveTransaction = True
- If St% <> 0 Then
- Msg$ = "Transaction Begin failed. Status = " + Str$(St%)
- T1% = MsgBox(Msg$, 0, "Warning!")
- End If
-
- End Sub
-
- Sub EndTransaction ()
- KeyBufLen% = 255
- BufLen% = 1
- KeyNum% = 0
- St% = 0
- St% = btrcall(BENDTRANS, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- ActiveTransaction = False
- End Sub
-
-